package com.framework.seedkit.ui;

import android.annotation.TargetApi;
import android.content.Intent;
import android.os.IBinder;
import android.os.PersistableBundle;
import android.os.RemoteException;
import android.service.carrier.CarrierIdentifier;
import android.service.carrier.CarrierMessagingService;
import android.service.carrier.CarrierService;
import android.telephony.CarrierConfigManager;

import com.framework.seedkit.utils.LOG;

/**
 * Created by ekimatsu on 16/12/8.
 */
@TargetApi(23)
public class MyCarrierService extends CarrierService implements CarrierMessagingService.ResultCallback<CarrierMessagingService.SendMmsResult>{
    public static final String TAG = MyCarrierService.class.getSimpleName();
    public MyCarrierService() {
        super();
    }

    @Override
    public IBinder onBind(Intent intent) {
        return super.onBind(intent);
    }

    @Override
    public PersistableBundle onLoadConfig(CarrierIdentifier id) {
        LOG.d("MyCarrierService Config being fetched");
        PersistableBundle config = new PersistableBundle();
        config.putBoolean(
                CarrierConfigManager.KEY_CARRIER_VOLTE_AVAILABLE_BOOL, true);
        config.putBoolean(
                CarrierConfigManager.KEY_CARRIER_VOLTE_TTY_SUPPORTED_BOOL, false);
        config.putInt(CarrierConfigManager.KEY_VOLTE_REPLACEMENT_RAT_INT, 6);
        // Check CarrierIdentifier and add more config if needed…
        return config;
    }

    @Override
    public void onReceiveResult(CarrierMessagingService.SendMmsResult result) throws RemoteException {
        LOG.d("onReceiveResult");
    }
}
